package com.dataconver.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 数据库配置属性类
 */
@Component
@ConfigurationProperties
public class DatabaseProperties {
    
    private Sqlserver sqlserver = new Sqlserver();
    private Mysql mysql = new Mysql();
    
    public Sqlserver getSqlserver() {
        return sqlserver;
    }
    
    public void setSqlserver(Sqlserver sqlserver) {
        this.sqlserver = sqlserver;
    }
    
    public Mysql getMysql() {
        return mysql;
    }
    
    public void setMysql(Mysql mysql) {
        this.mysql = mysql;
    }
    
    /**
     * SQLServer配置
     */
    public static class Sqlserver {
        private String url;
        private String username;
        private String password;
        private String driver;
        private int maxPoolSize = 10;
        private int minIdle = 5;
        
        public String getUrl() {
            return url;
        }
        
        public void setUrl(String url) {
            this.url = url;
        }
        
        public String getUsername() {
            return username;
        }
        
        public void setUsername(String username) {
            this.username = username;
        }
        
        public String getPassword() {
            return password;
        }
        
        public void setPassword(String password) {
            this.password = password;
        }
        
        public String getDriver() {
            return driver;
        }
        
        public void setDriver(String driver) {
            this.driver = driver;
        }
        
        public int getMaxPoolSize() {
            return maxPoolSize;
        }
        
        public void setMaxPoolSize(int maxPoolSize) {
            this.maxPoolSize = maxPoolSize;
        }
        
        public int getMinIdle() {
            return minIdle;
        }
        
        public void setMinIdle(int minIdle) {
            this.minIdle = minIdle;
        }
    }
    
    /**
     * MySQL配置
     */
    public static class Mysql {
        private String url;
        private String username;
        private String password;
        private String driver;
        private int maxPoolSize = 10;
        private int minIdle = 5;
        
        public String getUrl() {
            return url;
        }
        
        public void setUrl(String url) {
            this.url = url;
        }
        
        public String getUsername() {
            return username;
        }
        
        public void setUsername(String username) {
            this.username = username;
        }
        
        public String getPassword() {
            return password;
        }
        
        public void setPassword(String password) {
            this.password = password;
        }
        
        public String getDriver() {
            return driver;
        }
        
        public void setDriver(String driver) {
            this.driver = driver;
        }
        
        public int getMaxPoolSize() {
            return maxPoolSize;
        }
        
        public void setMaxPoolSize(int maxPoolSize) {
            this.maxPoolSize = maxPoolSize;
        }
        
        public int getMinIdle() {
            return minIdle;
        }
        
        public void setMinIdle(int minIdle) {
            this.minIdle = minIdle;
        }
    }
}
